$:.unshift File.join(File.dirname(__FILE__), "..", "lib")

require 'Callertest'
require 'test/unit'
require 'EventSetMock'

class Testcallertest < Test::Unit::TestCase
  def setup
      @reference_origin = EventSetMock.new
  end 
  
  def test_caller
    a = @reference_origin.return_callstack_head
    assert_equal(File.join(File.dirname(__FILE__), File.basename(__FILE__)), a[0], "filename #{a[0]} does not match")
    assert_equal("13", a[1], "linenumber #{a[1]} is not ok")
  end
  
  def testcaller2
    with0, with1 = @reference_origin.return_callstack_wo_offset
    assert(with0 != with1, "caller(0) : #{with0} \ncaller(1) : #{with1}")
  end

end